// home 模块的仓库
import mockRequest from "@/utils/mockRequest";
const state = {
    list:{}
}
const mutations = {
    GETDATA(state,list){
        state.list = list
    }
}
const actions = {
    // 发请求获取首页的mock数据
    async getData(context) {
        let result = await mockRequest.get('/home/list')
        // console.log(result)
        if (result.code == 20000) {
            context.commit('GETDATA',result.data)
        }
    }
}
const getter = {}
export default {
    state,
    mutations,
    actions,
    getter
}
